package models

import (
	"encoding/json"
	"time"
)

type Artist struct {
	BaseModel
	Name        string    `gorm:"size:255;not null"`
	Description string    `gorm:"type:text"`
	BirthDate   time.Time `gorm:"type:date"`
	Genre       string    `gorm:"size:100"`
	Active      bool      `gorm:"default:true"`
}

func (a *Artist) MarshalBinary() ([]byte, error) {
	return json.Marshal(a)
}

func (a *Artist) UnmarshalBinary(data []byte) error {
	return json.Unmarshal(data, a)
}
